package com.xiaoyu.izf.controller.api;

import com.xiaoyu.izf.model.exception.BusinessStatusEnum;
import com.xiaoyu.izf.model.page.FormResult;
import com.xiaoyu.izf.service.AppUpdateInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/app")
public class AppController{

    @Autowired
    private AppUpdateInfoService appUpdateInfoService;

    @GetMapping("/version/latest")
    public FormResult appUpdate(){
        return new FormResult(BusinessStatusEnum.OK,appUpdateInfoService.findLastAndroidVersion());
    }

    @RequestMapping("/ios/latest")
    public FormResult iosAppUpdate(){
        return new FormResult(BusinessStatusEnum.OK,appUpdateInfoService.findLastIOSVersion());
    }
}
